import request from '@/utils/request'

export function getList(params, data) {
  return request({
    url: '/data/getList',
    method: 'post',
    params,
    data
  })
}

export function batchDelete(data) {
  return request({
    url: '/data/delete',
    method: 'delete',
    data
  })
}
export function deleteByFilename(filename) {
  return request({
    url: '/data/deleteByFilename',
    method: 'delete',
    params: filename
  })
}
export function clear(data) {
  return request({
    url: '/data/clear',
    method: 'delete',
    data
  })
}

export function upload(data) {
  return request({
    url: '/data/upload',
    method: 'post',
    data
  })
}

export function addOneData(data) {
  return request({
    url: '/data/addOne',
    method: 'post',
    data
  })
}

export function downloadByCondition(data) {
  return request({
    url: '/data/download',
    method: 'post',
    data,
    responseType: 'blob',
    timeout: 1000 * 60 * 5
  })
}
